import request from '@/utils/http'
import type { Login_params, register_params, getVerifyCode_params } from './index.type'

// 登录
export const miniLogin = (params: Login_params) => {
  return request.post({
    url: '/api/user/oauth',
    data: params
  })
}

// 获取用户信息
export function getUserInfo() {
  return request.get({
    url: '/api/user'
  })
}

// 绑定手机号
export function register(data: register_params) {
  return request.post({
    url: '/api/user/oauth/bind',
    data
  })
}

// 获取验证码
export function getVerifyCode(data: getVerifyCode_params) {
  return request.post({
    url: '/api/user/verifyCode',
    data
  })
}

// 获取客户信息
export function getCustomerInfo(param) {
  return request.get({
    url: '/api/agg/user/info?taskId=' + param
  })
}
